<import file="block/common.html" name="url"/>
<div class="layui-fluid">
    <div class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label required">标题</label>
            <div class="layui-input-inline">
                <input type="text" name="title" lay-verify="required" lay-reqtext="标题不能为空" placeholder="请输入标题" value=""
                    class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">后台提交意见反馈，一般用于作为公共回复之类用处</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">提交人</label>
            <div class="layui-input-inline">
                <input type="text" name="name" lay-verify="required" lay-reqtext="提交人不能为空" placeholder="提交人不能为空"
                    value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">联系电话</label>
            <div class="layui-input-inline">
                <input type="text" name="phone" lay-verify="required" lay-reqtext="提交人联系电话不能为空" placeholder="提交人联系电话不能为空"
                    value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">内容</label>
            <div class="layui-input-block">
                <textarea name="content" class="layui-textarea" placeholder="请输入内容"></textarea>
            </div>
        </div>
        <!-- <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">回复内容</label>
            <div class="layui-input-block">
                <textarea name="re_content" class="layui-textarea" placeholder="请输入内容"></textarea>
            </div>
        </div> -->
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
                <input type="radio" name="status" value="1" title="显示">
                <input type="radio" name="status" value="0" title="不显示" checked>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="saveBtn"><?php echo lang('save');?></button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table', 'upload'], function () {
        var form = layui.form,
            layer = layui.layer,
            upload = layui.upload,
            $ = layui.$;
        form.render();

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.post('<{caUrl("feedback","add")}>', data.field, function (res) {
                if (res.status == 1) {
                    layer.msg(res.info, { icon: 1, time: 1000 }, function () {
                        loadMain('<{caUrl("feedback","index")}>');
                    });
                } else {
                    layer.msg(res.info, { icon: 2, anim: 6, time: 5000 });
                }
            });
            return false;
        });
       

    });
</script>